package com.chen.boot.controller;

import com.chen.common.Result;
import com.chen.boot.config.ClientConfig;
import com.chen.boot.config.GlobalListener;
import com.chen.boot.config.GlobalType;
import com.chen.boot.db.entity.ClientInfo;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Description
 * @Author Pengwei
 * @CreatDate 2021/11/17 10:19
 */
@RestController
public class NetController {
    @Resource
    ClientConfig clientConfig;

    //用于验证是否可以连通
    @PostMapping("checkConnect")
    public Object checkConnect() {
        ClientInfo clientInfo = clientConfig.getClientInfo();
        GlobalListener.instance.listenerEvent(GlobalType.checkBack,null);
        return Result.ok().setData(clientInfo);
    }
}
